package com.qizhou.base.dialog.lifecycledialog.cancelable

import androidx.fragment.app.DialogFragment

open class BaseCancelableHandler(dialogFragment: DialogFragment): ICancelableHandler {

    protected val dialogFragment: DialogFragment
    var cancelable: Boolean = true

    init {
        this.dialogFragment = dialogFragment
    }

    fun build(): BaseCancelableHandler {
        if (cancelable) {
            return CanCancelHandler(dialogFragment)
        } else {
            return CanNotCancelHandler(dialogFragment)
        }
    }

}